import request from '@/utils/request'

// 获取权限列表
export function getPermissionListAPI(params) {
  return request({
    url: '/sys/permission',
    params
  })
}
//
export const AddPermissionsAPI = (data) => {
  return request({
    url: '/sys/permission',
    method: 'POST',
    data
  })
}
// ID获取员工权限
export const GetuserPermissionsAPI = (id) => {
  return request({
    url: `/sys/permission/${id}`
  })
}
// ID更新员工权限
export const UpdatePermissionsAPI = (data) => {
  return request({
    url: `/sys/permission/${data.id}`,
    method: 'PUT',
    data
  })
}
// ID删除权限点
export const delPermissionsAPI = (id) => {
  return request({
    url: `/sys/permission/${id}`,
    method: 'DELETE'
  })
}
// 给角色分配权限
export const AssignPermissions = (data) => {
  return request({
    url: '/sys/role/assignPrem',
    method: 'PUT',
    data
  })
}
// 获取所有员工权限
export const GetEmployeePermissionsAPI = (params) => {
  return request({
    url: '/sys/permission',
    params
  })
}
